<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of sms_system
 *
 * @author enjaz1
 */
class sms_system extends admin_controller {

    //put your code here
    public function __construct() {
        parent::__construct();
        $this->load->model('admin/sms_model', 'sms_model');
    }

    public function index($offset = false) {
        $limit = metohd_get_uri('dblimit', ADMIN_LIMIT);
        $count = $this->sms_model->filter(true);
        $this->pass['count'] = $count;
        $this->pass['limit'] = $limit;
        $this->pass['result'] = $this->sms_model->filter(FALSE, $offset);
        $this->pass['pagination'] = $this->admin_pagination('index', $count, $limit);
        $this->load->library('sms');
        $this->pass['msg'] = $this->sms->get_blance();
        $this->themes->render('sms/index', $this->pass);
    }

    public function chart($offset = false) {
        $this->pass['all'] = get_message_sendto(false, true, 'all');
        $this->pass['wait'] = get_message_sendto(false, true, 'wait');
        $this->pass['send'] = get_message_sendto(false, true, 'send');
        $this->pass['fail'] = get_message_sendto(false, true, 'fail');
        $this->themes->render('sms/chart', $this->pass);
    }

}

?>
